import { objectAny } from "../../options/base";
import { mySchoolStore } from "../../store";

const riderUserCenter=uniCloud.importObject(`rider-user-center`,{customUI: true})


export async function db_riderGetOrderDetails({
    pageSize,
    startTime,
    endTime,
    status,
    justToDay=false,
    statistics=false
}={} as {
    pageSize:number,
    startTime?:number,
    endTime?:number;
    status:0|1|2|3,
    justToDay?:boolean;
    statistics?:boolean
}):Promise<{
    myErrCode:number;
    errMsg?:string;
    data?:{
        list:Array<objectAny>;
        statistics?:{
            completeCount:number        //完成订单数量
            cancelCount:number          //取消订单数量
            turnCount:number           //转单订单数量
        }
    }
}>{
    const schoolStore = mySchoolStore();
    const schoolId=schoolStore.mySchool._id

    return riderUserCenter.getOrderDetails(schoolId,{
        pageSize,
        startTime,
        endTime,
        status,
        justToDay,
        statistics
    });
}